<?php get_header(); ?>
<?php
	$options = get_option('arena_softech_options');
	if (function_exists('wp_list_comments')) {
		add_filter('get_comments_number', 'comment_count', 0);
	}
?>
<div id="content" class="grid_18">
	<div class="box-1">
		<div class="inner">
			<?php if (is_search()) : ?>
				<div class="boxcaption"><h3><?php _e('Search Results', 'arena_softech'); ?></h3></div>
				<div class="box"><?php printf( __('Keyword: &#8216;%1$s&#8217;', 'arena_softech'), wp_specialchars($s, 1) ); ?></div>

			<?php else : ?>
				<div class="boxcaption"><h3><?php
					// If this is a category archive
					if (is_category()) {
						printf( __('Archive for the &#8216;%1$s&#8217; Category', 'arena_softech'), single_cat_title('', false) );
					// If this is a tag archive
					} elseif (is_tag()) {
						printf( __('Posts Tagged &#8216;%1$s&#8217;', 'arena_softech'), single_tag_title('', false) );
					// If this is a daily archive
					} elseif (is_day()) {
						printf( __('Archive for %1$s', 'arena_softech'), get_the_time(__('M d, Y', 'arena_softech')) );
					// If this is a monthly archive
					} elseif (is_month()) {
						printf( __('Archive for %1$s', 'arena_softech'), get_the_time(__('M, Y', 'arena_softech')) );
					// If this is a yearly archive
					} elseif (is_year()) {
						printf( __('Archive for %1$s', 'arena_softech'), get_the_time(__('Y', 'arena_softech')) );
					// If this is an author archive
					} elseif (is_author()) {
						_e('Author Archive', 'arena_softech');
					// If this is a paged archive
					} elseif (isset($_GET['paged']) && !empty($_GET['paged'])) {
						_e('Blog Archives', 'arena_softech');
					}
					?></h3></div>
			<?php endif; ?>

			<?php if (have_posts()) : while (have_posts()) : 
				the_post(); 
				update_post_caches($posts); 
				$theFeaturedImg = get_post_meta($post->ID, 'thumbnail', true);
				?>
				<div class="post" id="post-<?php the_ID(); ?>">
					<h2><a class="title" href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h2>
					<div class="thumnai_post">
						<a href="<?php the_permalink() ?>">
						
						<?php if(isset($theFeaturedImg) && $theFeaturedImg ==""){ ?>
							<img src="<?php echo bloginfo( 'template_directory');?>/images/posts/1.jpg"/>
						<?php } else { ?>
							<img width="309" height="155" src="<?php echo $theFeaturedImg; ?>" alt="Featured Image" class="attachment-slider-post-thumbnail wp-post-image" />
						<?php } ?>
						</a>
					</div>
					<div class="info">
						<span class="date"><?php the_time(__('M d, Y', 'arena_softech')) ?></span>
						<?php if ($options['author']) : ?><span class="author"><?php the_author_posts_link(); ?></span><?php endif; ?>
						<?php edit_post_link(__('Edit', 'arena_softech'), '<span class="editpost">', '</span>'); ?>
						<span class="comments"><?php comments_popup_link(__('No comments', 'arena_softech'), __('1 comment', 'arena_softech'), __('% comments', 'arena_softech'), '', __('Comments off', 'arena_softech')); ?></span>
						<div class="fixed"></div>
					</div>
					<div class="content">
						<?php //the_content(__('Read more...', 'arena_softech'));
							the_excerpt();
						?>
						<div class="fixed"></div>
					</div>
					<div class="under">
						<?php if ($options['categories']) : ?><span class="categories"><?php _e('Categories: ', 'arena_softech'); ?></span><span><?php the_category(', '); ?></span><?php endif; ?>
						<?php if ($options['tags']) : ?><span class="tags"><?php _e('Tags: ', 'arena_softech'); ?></span><span><?php the_tags('', ', ', ''); ?></span><?php endif; ?>
					</div>
				</div>
			<?php endwhile; else : ?>
				<div class="errorbox">
					<?php _e('Sorry, no posts matched your criteria.', 'arena_softech'); ?>
				</div>
			<?php endif; ?>

			<div id="pagenavi">
				<?php if(function_exists('wp_pagenavi')) : ?>
					<?php wp_pagenavi() ?>
				<?php else : ?>
					<span class="newer"><?php previous_posts_link(__('Newer Entries', 'arena_softech')); ?></span>
					<span class="older"><?php next_posts_link(__('Older Entries', 'arena_softech')); ?></span>
				<?php endif; ?>
				<div class="fixed"></div>
			</div>
		</div>
	</div>
</div>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
